package com.lin.util;

import com.lin.entity.GroupInformation;

/**
 * @author Created by Lin Weihong
 * @date on 2022/4/18 19:32
 */
public class JudgeIsMemberUtil {
    public static boolean judgeMemberIsInGroup(GroupInformation groupInformation, int judgeUserId) {
        Integer masterId = groupInformation.getMasterId();
        Integer memberOneId = groupInformation.getMemberOneId();
        Integer memberTwoId = groupInformation.getMemberTwoId();
        Integer memberThreeId = groupInformation.getMemberThreeId();
        Integer memberFourId = groupInformation.getMemberFourId();
        if ((masterId.equals(judgeUserId)) || (memberOneId != null && memberOneId.equals(judgeUserId))
                || (memberTwoId != null && memberTwoId.equals(judgeUserId))
                || (memberThreeId != null && memberThreeId.equals(judgeUserId))
                || (memberFourId != null) && memberFourId.equals(judgeUserId)) {
            //在组内：
            return true;
        }
        return false;
    }
}
